use "chat rich communication.dta", clear


gen type=0
replace type=KAKat if KAKat==CHKat

gen pperiod=1
replace pperiod=2 if Period>5
replace pperiod=3 if Period>10
replace pperiod=4 if Period>15
replace pperiod=5 if Period>20
replace pperiod=6 if Period>25
replace pperiod=7 if Period>30
replace pperiod=8 if Period>35


tab type pperiod, column

gen treatment=6
replace treatment=5 if session=="150623_0942"
replace treatment=5 if session=="150722_0937"

sort treatment
by treatment:tab type pperiod, column
tab type pperiod, column
 
* type  = 1  is "Promise"
*		= 2  is "Social efficiency" A
*		= 3  is "Social efficiency" B
*		= 4  is "Admonition" A
*		= 5  is "Admonition" B
*		= 6  is "Don't choose C" A
*		= 7  is "Don't choose C" B
*		= 8  is "Don't choose C" C
*		= 9  is "Conversational" A
*		= 10 is "Conversational" B

label define categorie 100 "Coding conflict" 1 "Promise"  2 "Social efficiency" 3 "Admonition"  4 "Don't choose C" 5 "Coversational"
gen ttype=100
replace ttype=1 if type==1 

replace ttype=2 if type==2|type==3 
replace ttype=3 if type==4|type==5 
replace ttype=4 if type==6|type==7|ttype==8
replace ttype=5 if type==9|type==10  

replace ttype=2 if KAKat==2&CHKat==3
replace ttype=2 if KAKat==3&CHKat==2

replace ttype=3 if KAKat==4&CHKat==5
replace ttype=3 if KAKat==5&CHKat==4


replace ttype=4 if KAKat>5&CHKat>5&KAKat<9&CHKat<9
replace ttype=5 if KAKat>8&CHKat>8



label values ttype categorie

label define period 1 "P1-5" 2 "P6-10" 3 "P11-15" 4 "P16-20" 5 "P21-25" 6 "P26-30" 7 "P31-35" 8 "P36-40"

label values pperiod period

***    Table 4

tab ttype pperiod, column

****** Tables C1 and C2 

sort treat
by treat: tab ttype pperiod, column


sort session Subject Period
by session Subject Period: gen pippo=_n==1

***  last row of Table 4. Note that the numbers reported in the paper come from the difference between 640 and the second row of the following table (pippo=1) 

tab pippo pperiod

***  last row of Tables C1 and C2. Note that the numbers reported in the online appendix come from the difference between 320 and the second row of the following tables (pippo=1) 
sort treatment
by treatment: tab pippo pperiod



****  Tables D1, D2, D3

use "messages bare communication.dta" , clear
gen pperiod=1
replace pperiod=2 if Period>5
replace pperiod=3 if Period>10
replace pperiod=4 if Period>15
replace pperiod=5 if Period>20
replace pperiod=6 if Period>25
replace pperiod=7 if Period>30
replace pperiod=8 if Period>35

label define period 1 "P1-5" 2 "P6-10" 3 "P11-15" 4 "P16-20" 5 "P21-25" 6 "P26-30" 7 "P31-35" 8 "P36-40"

label values pperiod period

***  Table D1
tab Message pperiod, column

***  Tables D2 and D3
sort treatment
by treatment:tab Message pperiod, column


sort session Subject Period
by session Subject Period: gen pippo=_n==1

***  last row of Table D1. Note that the numbers reported in the online appendix come from the difference between 560 and the second row of the following table (pippo=1) 

tab pippo pperiod


***  last row of Tables D2 and D3. Note that the numbers reported in the online appendix come from the difference between 240 (Table D2) or 320 (Table D3) and the second row of the following tables (pippo=1) 

sort treatment
by treatment: tab pippo pperiod
